package com.aloda.mapper;

import com.aloda.dto.OperationLogPageDTO;
import com.aloda.entity.OperationLog;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface OperationLogMapper {

    /**
     * 插入操作日志数据
     */
    @Insert("insert into operate_log (user_id, username, description, time, class_name, method_name, method_params, return_value, cost_time,sort) " +
            "values (#{userId}, #{username}, #{description}, #{time}, #{className}, #{methodName}, #{methodParams}, #{returnValue}, #{costTime}, #{sort});")
    void insert(OperationLog operationLog);

    /**
     * 操作日志分页查询
     * @param pageDTO
     * @return
     */
    Page<OperationLog> pageQuery(OperationLogPageDTO pageDTO);

    void delete(List<Long> ids);
}
